#include "../Graphic/Graphic.h"
#include "../World/World.h"
#include "../World/Pathfinding.h"

/* Die Max. Anzahl von Entity's*/
#define Entity_Max 1024

#define E_WalkLeft 0
#define E_WalkRight 1
#define E_StopLeft 2
#define E_StopRight 3
#define E_Jump_StartLeft 4
#define E_Jump_StartRight 5
#define E_Jump_DownLeft 6
#define E_Jump_DownRight 7

extern short int E_Timer;

/* Entity struktur */
struct sEntity
{
    /* Nur für Network */
    unsigned short int Num;

    /* Aktuelle Position */
    float X;
    float Y;
    float Z;

    /* Zielposition */
    float XTarget;
    float YTarget;
    float ZTarget;

    /* nächster Wegpunkt */
    Waypoint *nextWp;

    /* Drehung */
    int R;

    /* Welche Animation*/
    int Animation;
    /* Welche er geblittet hat */
    int Animation_Num;
    /* Speed */
    int Animation_Speed;

    int Energy;

    /* Fuktion zu berechnung */
    unsigned short int Process;
    signed WorkProcess;
    signed Work;


    /* Leben */
    unsigned short int Live;

    /* Besitzer */
    signed char Team;

    /* Angehängt */
    int AttachNum;

    /* Ob sich verändert hat (Bewegung ect.)*/
    unsigned char Change;
};

/* Start stuff */
int Entity_Init();

/* Pointer */
extern struct sEntity Entity[ Entity_Max ];

/* Null Pointer setzten */
void Entity_None( struct sEntity *Obj );

/* System Obj */
void Entity_Border( struct sEntity *Obj );

/* Gibt Entity zurück */
struct sEntity *Entity_Get( int iN );

/* Erstellen eines Obj */
struct sEntity *Entity_Create(int X, int Y, int Live, int Process);

/* Löschen eines Entity's OHNE effekte */
void Entity_Remove( struct sEntity *Obj );

Uint32 Entity_Process(Uint32 intervall, void *parameter);

void Entity_Process_Graphic();
